package com.mc.cloud.mall.cartOrder.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName MallWebMvcConfig
 * @Author MC
 * @Date 2021/5/24 19:24
 * @Version 1.0
 **/
@Configuration
public class MallWebMvcConfig implements WebMvcConfigurer {
    
    @Value("${file.upload.dir}")
    String FILE_UPLOAD_DIR;
    
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        
        registry.addResourceHandler("/images/**").addResourceLocations("file:"+FILE_UPLOAD_DIR);
        
        
        
    }
}
